package com.xiaouyudeguang.common.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.HashMap;
import java.util.Map;

@Data
@Configuration
@ConfigurationProperties(prefix = "spring.gateway")
public class RouteConfig {

    private Map<String, String> routers = new HashMap<>();

    public String getValue(String name) {
        for (String key : routers.keySet()) {
            if (name.equals(routers.get(key))) {
                return key;
            }
        }
        return null;
    }
}
